<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<!DOCTYPE HTML>
<html lang="zh">
<head>
	<%@include file="/WEB-INF/jsp/common/header.jsp"%>
    <script src="<%=request.getContextPath()%>/resources/jquery-file-upload/js/vendor/jquery.ui.widget.js" type="text/javascript"></script>
    <script src="<%=request.getContextPath()%>/resources/jquery-file-upload/js/jquery.fileupload.js" type="text/javascript"></script>
	<link href="<%=request.getContextPath()%>/resources/umeditor/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
	<script type="text/javascript" charset="utf-8" src="<%=request.getContextPath()%>/resources/umeditor/umeditor.config.js"></script>
	<script type="text/javascript" charset="utf-8" src="<%=request.getContextPath()%>/resources/umeditor/umeditor.min.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/resources/umeditor/lang/zh-cn/zh-cn.js"></script>
	<style type="text/css">
		.input-group-addon:not(.auto){width:90px;}
		#editModal input:not(.auto){width:450px;}
		#editModal textarea{width:450px;}
        .input-group {
            position: relative;
            display: table;
            border-collapse: separate;
        }
		.thumbnail{
			width: 100px;
			height: 100px;
		}
	</style>
</head>
<body>
<div class="container-fluid" style="padding-top: 10px;">
	<button id="add" type="button" class="btn btn-info" onclick="addProduct()">新增</button>
	<br />
	<form id="form" class="form-inline" role="form" action="#" method="get" style="padding-top: 10px;">
		<div class="form-group">
			<div class="input-group">
				<span class="input-group-addon">名称</span>
				<input type="text" class="form-control" id="product_name" value="" placeholder="产品名称" style="width: 130px;">
			</div>
			<div class="input-group">
				<span class="input-group-addon">类型</span>
				<select id="type_id_select" class="form-control">
					<option value="">全部</option>
					<c:forEach var="item" items="${typeList}">
						<option value="${item.id}">${item.name}</option>
					</c:forEach>
				</select>
			</div>
            <div class="input-group">
                <span class="input-group-addon">状态</span>
                <select id="status_select" class="form-control">
                    <option value="" selected>全部</option>
                    <option value="0">下架</option>
                    <option value="1">上架</option>
                </select>
            </div>
			<button type="button" class="btn btn-primary" onclick="searchTable()">查询</button>
			<button type="button" class="btn btn-default" id="resetForm">清空</button>
		</div>
	</form>
	<br />
	<div>
		<table class="table table-hover table-striped table-bordered" style="table-layout:fixed;" id="productListTable"></table>
	</div>
</div>

<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-dialog modal-lg" style="width: 600px;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
				</button>
				<h4 class="modal-title" id="modalTitle">编辑产品</h4>
			</div>
			<div class="modal-body">
				<div class="form-group template" style="margin-bottom: 5px; display: none" id="normTemplate">
					<div class="input-group">
						<span class="input-group-addon auto">名称</span>
						<input type="text" class="form-control auto" name="normList[0].name" placeholder="比如容量350ml">
						<span class="input-group-addon auto">价格($)</span>
						<input type="text" class="form-control auto" name="normList[0].inputPrice" placeholder="价格">
						<div class="input-group-btn">
							<a href="javascript:;" onclick="removeNormTemplate(event)" class="btn btn-success"> <i class="fa fa-minus"></i> </a>
						</div>
						<input type="hidden" name="normList[0].id">
						<input type="hidden" name="normList[0].price">
					</div>
				</div>
				<div class="form-group template" style="margin-bottom: 5px; display: none" id="propertyTemplate">
					<div class="input-group">
						<span class="input-group-addon auto">名称</span>
						<input type="text" class="form-control auto" name="propertyList[0].name" placeholder="属性名称，比如颜色">
						<span class="input-group-addon auto">：</span>
						<input type="text" class="form-control auto" name="propertyList[0].norm" title="比如：蓝色;粉色，多个属性分号相隔" placeholder="多个属性分号相隔">
						<div class="input-group-btn">
							<a href="javascript:;" onclick="removePropertyTemplate(event)" class="btn btn-success"> <i class="fa fa-minus"></i> </a>
						</div>
						<input type="hidden" name="propertyList[0].id">
					</div>
				</div>
				<form id="editForm">
					<input type="hidden" name="id">
					<table id="editTable" class="table table-bordered">
						<tr>
							<td>
								<div class="input-group">
									<span class="input-group-addon">产品名称</span> <input type="text" class="form-control" name="name" placeholder="商品名称">
								</div>
                                <input type="file" id="hiddenFileInput" style="display: none;">
							</td>
						</tr>
						<tr>
							<td>
								<img id="picImg" src="${pageContext.request.contextPath}/resources/img/icon-upload.png" id="picImg" class="thumbnail" onclick="selectUploadFile()">
                                <input type="hidden" id="hiddenPicInput" name="picUrl">
                                <div class="contextual-progress" id="progress" style="display: none;">
                                    <div class="progress">
                                        <div class="progress-bar progress-bar-info" style="width: 0%"></div>
                                    </div>
                                </div>
							</td>
						</tr>
						<c:if test="${brandShow}">
						<tr>
							<td>
								<div class="input-group">
									<span class="input-group-addon">品牌</span> <input type="text" class="form-control" name="brand" placeholder="品牌">
								</div>
							</td>
						</tr>
						</c:if>
						<tr>
							<td>
								<div class="input-group">
									<span class="input-group-addon">产品类型</span>
									<select name="typeId" class="form-control">
										<c:forEach var="item" items="${typeList}">
											<option value="${item.id}" hasProperty="${item.hasProperty}" hasNorm="${item.hasNorm}">${item.name}</option>
										</c:forEach>
									</select>
								</div>
							</td>
						</tr>
						<tr>
							<td>
								<div class="input-group">
									<span class="input-group-addon">价格($)</span> <input type="text" class="form-control" name="inputPrice" placeholder="价格，多规格以规格价格为准">
                                    <input type="hidden" id="editPriceHidden" name="price">
								</div>
							</td>
						</tr>
						<tr>
							<td>
								<div class="input-group">
									<span class="input-group-addon">单位</span> <input type="text" class="form-control" name="unit" placeholder="单位">
								</div>
							</td>
						</tr>
						<tr>
							<td>
								<div class="input-group">
									<span class="input-group-addon">产品简介</span>
									<textarea class="form-control" name="introduction" rows="3" placeholder="产品简介"></textarea>
								</div>
							</td>
						</tr>
						<tr>
							<td>
								<div class="input-group">
									<span class="input-group-addon">产品状态</span>
									<select name="status" class="form-control">
										<option value="0">下架</option>
										<option value="1">上架</option>
									</select>
								</div>
							</td>
						</tr>
						<tr mark="norm">
							<td>
                                <p>规格：<a href="javascript:addNorm();" class="btn btn-success"> <i class="fa fa-plus"></i> </a></p>
                                <div id="normArea"></div>
							</td>
						</tr>
						<tr mark="property">
							<td>
                                <p>属性：<a href="javascript:addProperty();" class="btn btn-success"> <i class="fa fa-plus"></i> </a></p>
                                <div id="propertyArea"></div>
                            </td>
						</tr>
						<tr>
							<td align="center">
								<button id="btn_submit" type="button" class="btn btn-success" style="width: 100px;">保存</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<button type="button" class="btn btn-danger" style="width: 100px;" data-dismiss="modal">关闭</button>
							</td>
						</tr>
					</table>
				</form>
			</div>
		</div>
	</div>
</div>

<div class="modal fade" id="contentModal" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-dialog modal-lg" style="width: 790px;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
				</button>
				<h4 class="modal-title" id="contentTitle">编辑</h4>
			</div>
			<div class="modal-body">
				<form id="settingForm">
					<input type="hidden" id="pid" name="id">
					<table id="settingTable" class="table-hover table table-bordered">
						<tr>
							<td>
								<p id="myEditor" style="width:740px;height:240px;"></p>
							</td>
						</tr>
						<tr>
							<td align="center">
								<button id="contentSaveBtn" type="button" class="btn btn-success addForm">保 存</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<button type="button" onclick="$('#contentModal').modal('hide');" class="btn btn-danger addForm">关闭</button>
							</td>
						</tr>
					</table>
				</form>
			</div>
		</div>
	</div>
</div>

<script type="text/javascript">
	var productListTable;
    $(document).ready(function(){
        $("#resetForm").click(function(){
            $("#form input").val("");
        });

        $("#btn_submit").click(function() {
            var id = $("#editModal input[name=id]").val();
            var name = $("#editModal input[name=name]").val();
            var inputPrice = $("#editModal input[name=inputPrice]").val();
            var introduction = $("#editModal textarea[name=introduction]").val();
            var unit = $("#editModal input[name=unit]").val();
            var typeId = $("#editModal select[name=typeId]").val();
            var brand = $("#editModal input[name=brand]").val();
            var reg = /^[0-9]+(.[0-9]{1,2})?$/;
            if (name === "") {
                $.messager.alert("产品名不能为空");
                return false;
            }
            if (inputPrice === "" || !reg.test(inputPrice)) {
                $.messager.alert("价格不能为空且必须是数字，最多保留2位小数");
                return false;
            }
            if(unit === '' || unit.length > 10){
                $.messager.alert("单位是必填的，且不能超过10个字符");
                return false;
            }
            if(introduction === '' || introduction.length > 200){
                $.messager.alert("简介是必填的，且不能超过200个字符");
                return false;
            }
            if(typeId === ''){
                $.messager.alert("类型是必填的");
                return false;
			}
            $('#editPriceHidden').val((parseFloat(inputPrice) * 100).toFixed(0));

            var valid = true;
            $('#normArea').find('.form-group').each(function(index, dom){
                var val = $(dom).find('input[name^=normList]:eq(0)').val();
                if(val === "") {
                    valid = false;
                    return;
                }
                var price = $(dom).find('input[name^=normList]:eq(1)').val();
                if(price === "" || !reg.test(price)) {
                    valid = false;
                    return;
                }
                $(dom).find('input[name^=normList]:eq(3)').val((parseFloat(price) * 100).toFixed(0));
            });
            if(!valid){
                $.messager.alert("提示", "规格必填，必须价格为数字");
                return;
            }
            $('#propertyArea').find('.form-group').each(function(index, dom){
                var val = $(dom).find('input[name^=propertyList]:eq(0)').val();
                if(val === "") valid = false;
                val = $(dom).find('input[name^=propertyList]:eq(1)').val();
                if(val === "") valid = false;
            });
            if(!valid){
                $.messager.alert("提示", "属性名称和内容必填");
                return;
            }
            $(this).attr("disabled","disabled");
            var url = contextpath + "/web/product/insert";
            if(id != null && id !== ""){
                url = contextpath + "/web/product/update";
            }

            $.ajax({
                type : "POST",
                url : url,
                data : $('#editForm').serialize(),
                success : function(result) {
                    $("#btn_submit").removeAttr("disabled");
                    if (result.code === 200) {
                        productListTable.ajax.reload();
                        $('#editModal').modal('hide')
                        $.messager.alert("提示", "保存成功");
                    } else {
                        $.messager.alert(result.msg);
                    }
                },
                error:function(){
                    $("#btn_submit").removeAttr("disabled");
                    $.messager.alert("提示", "保存失败，请检查网络");
                }
            });
        });

        productListTable = $('#productListTable').DataTable({
            "bSort": true, //是否启动各个字段的排序功能
			"aaSorting": [[<c:if test="${brandShow}">6</c:if><c:if test="${not brandShow}">5</c:if>, "desc"]], //默认的排序方式
            "aoColumns": [
                {
                    "mDataProp": "id",
                    "sTitle":"ID",
                    "sDefaultContent": "--",
                    "sWidth": "60",
                    "sClass": "center flow",
                    "bSortable": false,//是否支持排序
                    "bSearchable" : false,//是否支持条件查询
                    "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
                        if(sData !== '--') $(nTd).attr('title', sData);
                    }
                },{
                    "mDataProp": "name",
                    "sTitle":"名称",
                    "sDefaultContent": "--",
                    "sWidth": "20%",
                    "sClass": "center flow",
                    "bSortable": false,//是否支持排序
                    "bSearchable" : true,//是否支持条件查询
                    "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
                        if(sData !== '--') $(nTd).attr('title', sData);
                    }
                },
				<c:if test="${brandShow}">
                {
                    "mDataProp": "brand",
                    "sTitle":"品牌",
                    "sDefaultContent": "--",
                    "sWidth": "20%",
                    "sClass": "center flow",
                    "bSortable": false,//是否支持排序
                    "bSearchable" : false,//是否支持条件查询
                    "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
                        if(sData !== '--') $(nTd).attr('title',sData);
                    }
                },
                </c:if>
                {
                    "mDataProp": "price",
                    "sTitle":"价格($)",
                    "sDefaultContent": "--",
                    "sWidth": "20%",
                    "sClass": "center flow",
                    "bSortable": false,//是否支持排序
                    "bSearchable" : false,//是否支持条件查询
                    "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
                        if(sData !== '--') {
                            $(nTd).html((sData/100).toFixed(2) + "元");
						}
                    }
                },
                {
                    "mDataProp": "typeName",
                    "sTitle":"产品类型",
                    "sDefaultContent": "--",
                    "sWidth": "20%",
                    "sClass": "center flow",
                    "bSortable": false,//是否支持排序
                    "bSearchable" : false,//是否支持条件查询
                    "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
                        if(sData !== '--') $(nTd).attr('title',sData);
                    }
                },
                {
                    "mDataProp": "status",
                    "sTitle": "状态",
                    "sWidth": "15%",
                    "sDefaultContent": "--",
                    "bSortable": false,
                    "sClass": "center flow",
                    "bSearchable": false,//是否支持条件查询
                    "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
                        if (sData === 1) $(nTd).html('上架').attr('title', '上架');
                        else $(nTd).html('下架').attr('title', '下架');
                    }
                },
                {
                    "mDataProp": "createTime",
                    "sTitle": "创建时间",
                    "sWidth": "15%",
                    "sDefaultContent": "--",
                    "bSortable": true,
                    "sClass": "center flow",
                    "bSearchable": false,//是否支持条件查询
                    "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
                        if (sData !== '--') $(nTd).attr('title', sData);
                    }
                },
                {
                    "mDataProp": "id",
                    "sTitle": "操作",
                    "sWidth": "180px",
                    "sClass": "center flow",
                    "bSearchable": false,
                    "bSortable": false,
                    "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
                        $(nTd).html("<a class='btn btn-xs btn-default' href='javascript:void(0);' onclick='editProduct(" + iRow + ")'><i class='fa fa-pencil'></i>&nbsp;编辑</a> &nbsp;")
                            .append("<a class='btn btn-xs btn-default' href='javascript:void(0);' onclick='editContent(" + iRow + ")'><i class='fa fa-pencil-square-o'></i>&nbsp;介绍</a> &nbsp;")
							.append("<a class='btn btn-xs btn-default' href='javascript:void(0);' onclick='deleteProduct(" + iRow + ")'><i class='fa fa-times'></i>&nbsp;删除</a>");
                    }
                }
            ],
            "ajax": {
                url: contextpath + '/web/product/queryPage',
                type:"post",
                data: function(data){
                    $.xDataTablesParams(data, $.trim($('#product_name').val()));
                    data['search.viewType'] = '${viewType}';
                    data['search.typeId'] = $('#type_id_select').val();
                    data['search.status'] = $('#status_select').val();
                    return data;
                }
            }
        });

        $('#editModal').on('hide.bs.modal', function () {
            $("#btn_submit").removeAttr('disabled');
            $('#editForm :input').val('');
            $('#normArea, #propertyArea').empty();
            $('#picImg').attr('src', '${pageContext.request.contextPath}/resources/img/icon-upload.png');
        });

        //上传图片
        $("#hiddenFileInput").change(function(){
            $('#uploadProgressDlg').modal('show');
            $('#progress').show();
        });
        //图片上传
        $("#hiddenFileInput").fileupload({
            url : contextpath + '/web/upload/uploadFile',
            dataType: 'json',
            formData : function(form){
                return []
            },
            done: function (e, data) {
                $('#uploadProgressDlg').modal('hide');
                var file = data.files[0];
                console.log(data.result);
                if(data.result.code !== 200){
                    $.messager.alert("提示", "图片上传不成功");
                    return;
                }
                $("#hiddenPicInput").val(data.result.data.path);
                $('#picImg').attr('src', data.result.data.server + data.result.data.path);

                $('#uploadProgressDlg .progress-percentage').text("-- KB");
                $('#uploadProgressDlg .progress-bar').css('width', '0%');
                $('#progress').hide();
                $('#progress .progress-bar').css('width', '0%');
            },
            progressall: function (e, data) {
                var progress = parseInt(data.loaded / data.total * 100, 10);
                $('#uploadProgressDlg .progress-percentage').text(data.loaded/1000 + "/" + data.total/1000 + " KB");
                $('#uploadProgressDlg .progress-bar').css('width', progress + '%');
                $('#progress .progress-bar').css('width', progress + '%');
            }
        }).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled');

        $('#contentSaveBtn').click(function(){
            if(!UM.getEditor('myEditor').hasContents()){
                $.messager.alert("提示", "详情内容不能为空");
                return;
			}
			var content = UM.getEditor('myEditor').getContent();
            var id = $('#pid').val();
			$.ajax({
				type : "POST",
				url : contextpath + '/web/product/updateRemark',
				data : {id:id, remark:content},
				success : function(result) {
					$("#contentSaveBtn").removeAttr("disabled");
					if (result.code === 200) {
						productListTable.ajax.reload(null, false);
						$('#contentModal').modal('hide')
						$.messager.alert("提示", "保存成功");
					} else {
						$.messager.alert("提示", result.msg);
					}
				},
				error:function(){
					$("#contentSaveBtn").removeAttr("disabled");
					$.messager.alert("提示", "保存失败，请检查网络");
				}
			});
		});
    });

    function searchTable(){
        productListTable.ajax.reload();
    }

    function editProduct(row){
        $('#modalTitle').text('编辑产品');
        var rowData = productListTable.row(row).data();
        $('#editModal :input[name=id]').val(rowData.id);
        $('#editModal :input[name=name]').val(rowData.name);
        $('#editModal :input[name=brand]').val(rowData.brand);
        $('#editModal :input[name=inputPrice]').val((rowData.price/100).toFixed(2));
        $('#editModal :input[name=price]').val(rowData.price);
        $('#editModal :input[name=picUrl]').val(rowData.picUrl);
        $('#editModal :input[name=remark]').val(rowData.remark);
        $('#editModal :input[name=introduction]').val(rowData.introduction);
        $('#editModal :input[name=unit]').val(rowData.unit);
        $('#editModal :input[name=typeId]').val(rowData.typeId);
        if(!rowData.picUrl || rowData.picUrl === ''){
            $('#picImg').attr('src', '${pageContext.request.contextPath}/resources/img/icon-upload.png');
        }else{
            $('#picImg').attr('src', '${fileViewServer}' + rowData.picUrl);
        }

        $("#editModal :input[name=status]").val(rowData.status);

		if(rowData.normList) for(var x in rowData.normList){
			addNorm(rowData.normList[x]);
		}
		if(rowData.propertyList) for(var x in rowData.propertyList){
		    addProperty(rowData.propertyList[x]);
		}

        $('#editModal').modal('show');
    }

    function addProduct(){
        $('#modalTitle').text('新增产品');
        $('#editModal').modal('show');
    }

    function deleteProduct(row){
        var rowData = productListTable.row(row).data();
        $.messager.confirm("确定", "真的要删除'" + rowData.name + "'吗？", function(){
            $.ajax({
                url : contextpath + '/web/product/delete/' + rowData.id,
                type : 'DELETE',
                success :  function(data){
                    if (data.code === 200) {
                        $.messager.alert("删除成功");
                        productListTable.ajax.reload();
                    } else {
                        $.messager.alert(data.msg);
                    }
                }
            });
        });
    }

    function removeNormTemplate(event) {
        $(event.target).parents('.template').remove();
        $('#normArea').find('.template').each(function(index, dom){
            $(dom).find('input[name^=normList]:eq(0)').attr('name', 'normList['+ index +'].name');
            $(dom).find('input[name^=normList]:eq(1)').attr('name', 'normList['+ index +'].norm');
            $(dom).find('input[name^=normList]:eq(2)').attr('name', 'normList['+ index +'].id');
        });
    }

    function addNorm(norm){
        var $temp = $('#normTemplate').clone().removeAttr('id').show();
        if(norm){
            $temp.find('input[name^=normList]:eq(0)').val(norm.name);
            $temp.find('input[name^=normList]:eq(1)').val((norm.price/100).toFixed(2));
            $temp.find('input[name^=normList]:eq(2)').val(norm.id);
		}
        $('#normArea').append($temp);
        $('#normArea').find('.template').each(function(index, dom){
            $(dom).find('input[name^=normList]:eq(0)').attr('name', 'normList['+ index +'].name');
            $(dom).find('input[name^=normList]:eq(1)').attr('name', 'normList['+ index +'].inputPrice');
            $(dom).find('input[name^=normList]:eq(2)').attr('name', 'normList['+ index +'].id');
            $(dom).find('input[name^=normList]:eq(3)').attr('name', 'normList['+ index +'].price');
        });
    }
    function removePropertyTemplate(event) {
        $(event.target).parents('.template').remove();
        $('#propertyArea').find('.template').each(function(index, dom){
            $(dom).find('input[name^=propertyList]:eq(0)').attr('name', 'propertyList['+ index +'].name');
            $(dom).find('input[name^=propertyList]:eq(1)').attr('name', 'propertyList['+ index +'].property');
            $(dom).find('input[name^=propertyList]:eq(2)').attr('name', 'propertyList['+ index +'].id');
        });
    }

    function addProperty(property){
        var $temp = $('#propertyTemplate').clone().removeAttr('id').show();
        if(property){
            $temp.find('input[name^=propertyList]:eq(0)').val(property.name);
            $temp.find('input[name^=propertyList]:eq(1)').val(property.property);
            $temp.find('input[name^=propertyList]:eq(2)').val(property.id);
        }
        $('#propertyArea').append($temp);
        $('#propertyArea').find('.template').each(function(index, dom){
            $(dom).find('input[name^=propertyList]:eq(0)').attr('name', 'propertyList['+ index +'].name');
            $(dom).find('input[name^=propertyList]:eq(1)').attr('name', 'propertyList['+ index +'].property');
            $(dom).find('input[name^=propertyList]:eq(2)').attr('name', 'propertyList['+ index +'].id');
        });
    }

    /**
     *
     * @param index
     */
    function selectUploadFile(){
        $('#hiddenFileInput').click();
    }

    var um = UM.getEditor('myEditor', {
        imageUrl : contextpath + '/web/upload/uEditor',
        imagePath: '${fileViewServer}',
        toolbar:[
        'source | undo redo | bold italic underline strikethrough | superscript subscript | forecolor backcolor | removeformat |',
        'insertorderedlist insertunorderedlist | selectall cleardoc paragraph | fontfamily fontsize' ,
        '| justifyleft justifycenter justifyright justifyjustify |',
        'link unlink | image | map',
        '| horizontal print preview fullscreen', 'drafts', 'formula'
    ]
	});

    function editContent(iRow){
        $('#contentModal').modal('show');
        var rowData = productListTable.row(iRow).data();
		$('#pid').val(rowData.id);
		$('#edui-btn-toolbar .edui-icon-fullscreen').hide();
        $('#contentTitle').text(rowData.name + " 详情编辑");
        $('#contentModal').modal('show');
        um.setContent(rowData.remark, false);
	}

</script>
</body>